From: msizanoen1 Date: Thu, 26 May 2022 06:15:06 +0000 (+0700) Subject: shell: Do not create a systemd scope when using D-Bus app launching X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~318 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=afcd58e3bafe7ac817f883f40e87993ebfe482a7;p=gnome-shell.git shell: Do not create a systemd scope when using D-Bus app launching Applications launched using D-Bus activation will have a returned PID of 0, which systemd interprets as moving the requesting process to a new scope, causing GNOME Shell to be moved to another scope. Fix this by not creating a systemd scope when PID is 0. Part-of: --- diff --git a/src/shell-global.c b/src/shell-global.c index efe1271b5..60f078f3b 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -1399,6 +1399,11 @@ shell_global_app_launched_cb (GAppLaunchContext *context, if (!g_variant_lookup (platform_data, "pid", "i", &pid)) return; + /* If pid == 0 the application was launched through D-Bus + * activation, therefore it's already in its own unit */ + if (pid == 0) + return; + app_name = g_app_info_get_id (info); if (app_name == NULL) app_name = g_app_info_get_executable (info);